<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java对象生命周期与垃圾回收机制</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .card-hover {
            transition: all 0.3s ease;
            border: 1px solid transparent;
        }
        
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            border-color: #667eea;
        }
        
        .text-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }
        
        .section-title {
            position: relative;
            padding-left: 20px;
        }
        
        .section-title::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            width: 4px;
            height: 24px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 8px;
            margin-top: -8px;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
        
        .reference-card {
            background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
            border-left: 4px solid;
            transition: all 0.3s ease;
        }
        
        .reference-card:hover {
            transform: translateX(5px);
        }
        
        .strong-ref { border-left-color: #ef4444; }
        .soft-ref { border-left-color: #f59e0b; }
        .weak-ref { border-left-color: #3b82f6; }
        .phantom-ref { border-left-color: #8b5cf6; }
        
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        
        code {
            background: rgba(102, 126, 234, 0.1);
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'Consolas', 'Monaco', monospace;
            color: #667eea;
        }
        
        .fade-in {
            animation: fadeIn 0.8s ease-in;
        }
        
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <div class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto text-center fade-in">
            <h1 class="text-5xl md:text-6xl font-bold mb-6">
                <i class="fas fa-recycle mr-4"></i>
                Java 对象生命周期
            </h1>
            <p class="text-xl md:text-2xl opacity-90 max-w-3xl mx-auto">
                深入理解垃圾回收机制，掌握对象"生死"判定的核心原理
            </p>
        </div>
    </div>

    <!-- Main Content -->
    <div class="max-w-6xl mx-auto px-6 py-12">
        <!-- Introduction Card -->
        <div class="bg-white rounded-2xl shadow-xl p-8 mb-12 card-hover fade-in">
            <p class="text-lg leading-relaxed text-gray-700">
                <span class="drop-cap">在</span>Java 的世界里，对象的生命周期管理是一个精妙而复杂的过程。当我们创建一个对象时，它开始了自己的生命旅程；而当它不再被任何引用所使用时，垃圾回收器（GC）将判定它已经"死去"，并将其回收。这个看似简单的过程，背后蕴含着深刻的设计哲学和技术智慧。
            </p>
        </div>

        <!-- Reference Types Section -->
        <div class="mb-16">
            <h2 class="text-3xl font-bold mb-8 section-title">
                <i class="fas fa-link mr-3 text-purple-600"></i>引用类型体系
            </h2>
            
            <div class="grid md:grid-cols-2 gap-6">
                <div class="reference-card strong-ref p-6 rounded-xl shadow-lg card-hover">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-anchor text-3xl text-red-500 mr-4"></i>
                        <h3 class="text-xl font-bold">强引用 Strong Reference</h3>
                    </div>
                    <p class="text-gray-700 mb-3">最常见的引用类型，如 <code>Object obj = new Object();</code></p>
                    <p class="text-sm text-gray-600">只要强引用存在，对象永远不会被回收，即使内存不足也会抛出 OutOfMemoryError。</p>
                </div>
                
                <div class="reference-card soft-ref p-6 rounded-xl shadow-lg card-hover">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-cloud text-3xl text-yellow-500 mr-4"></i>
                        <h3 class="text-xl font-bold">软引用 Soft Reference</h3>
                    </div>
                    <p class="text-gray-700 mb-3">通过 <code>SoftReference</code> 类实现，适用于缓存场景</p>
                    <p class="text-sm 